#include "Col.ph"
#ifdef __GNUG__
#pragma implementation
#endif

#include "SysEvtHandler.h"

#include "Class.h"
#include "OrdColl.h"
#include "System.h"

//---- SysEvtHandler -----------------------------------------------------------

NewAbstractMetaImpl0(SysEvtHandler,Object);

SysEvtHandler::SysEvtHandler(int)
{
}

SysEvtHandler::~SysEvtHandler()
{
}

bool SysEvtHandler::Notify()
{
	return FALSE;
}

void SysEvtHandler::Remove()
{
	if (gSystem)
		gSystem->AddCleanupObject(this);
}

//---- FileHandler -------------------------------------------------------------

NewMetaImpl(FileHandler,SysEvtHandler, (T(fd), T(mask)));

FileHandler::FileHandler(int f, int m) : SysEvtHandler(123)
{
	fd= f;
	if (m == 0)
		m= 1;
	mask= m;
}

bool FileHandler::ReadNotify()
{
	return FALSE;
}

bool FileHandler::WriteNotify()
{
	return FALSE;
}

bool FileHandler::HasReadInterest()
{
	return (mask & 1);
}

bool FileHandler::HasWriteInterest()
{
	return (mask & 2);
}

//---- SignalHandler -----------------------------------------------------------

NewMetaImpl(SignalHandler,SysEvtHandler, (TE(sig), TB(sync)));

SignalHandler::SignalHandler(Signals s, bool sy) : SysEvtHandler(123)
{
	sig= s;
	sync= sy;
}

